/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.quadbac.measurements;

import java.io.Serializable;

/**
 *
 * @author Steve
 */
@SuppressWarnings("serial")
public class Measurement implements Serializable {
    private Double value = 0.0;
    private MeasurementType type;

    public Measurement(){
    }
    public Measurement(MeasurementType type) {
        this();
        this.type = type;
    }
    public void setValue(Double valueInUnits, Unit unit){
        value = unit.getUnitTransform().inverse(valueInUnits);
    }
    public Double getValue(Unit unit){
        return unit.getUnitTransform().transform(value);
    }
    public void setType(MeasurementType type){
        this.type = type;
    }
    public MeasurementType getType(){
        return type;
    }
}